<?php
interface interface_user_dao {
 
    // return class name of returned user object
    public function get_user_type();

    // return user object by email
    public function get_by_email($email);

    // return user object by username
    public function get_by_username($username);

    // return user object by token and empty token
    public function get_by_token($token);

    // return user object by id
    public function get_by_id($user_id);

    // return user object if login is valid
    // or false if fails to login
    public function login($username, $password); 

    public function logout(interface_user $user);

    // return array of user group permissions
    public function get_permissions(interface_user $user_group_id);

    // update user ip
    public function update_ip(interface_user $user, $ip);

    // update session with user data
    public function update_session(interface_user $user, $session);

    // update user with session data
    public function update_user(interface_user $user, $session);

    // user logout
} 
